import baseRequest from "./request";

export function getMenuList(params?: any) {
  return baseRequest({
    url: '/system/menu/list',
    method: 'get',
    params
  });
}
export function getMenuTree(params?: any) {
  return baseRequest({
    url: '/system/menu/tree',
    method: 'get',
    params
  });
}

export function getMenuDetail(id: number) {
  return baseRequest({
    url: `/system/menu/${id}`,
    method: 'get'
  });
}

export function createMenu(data: any) {
  return baseRequest({
    url: '/system/menu',
    method: 'post',
    data
  });
}

export function updateMenu(id: number, data: any) {
  return baseRequest({
    url: `/system/menu/${id}`,
    method: 'put',
    data
  });
}

export function deleteMenu(id: number) {
  return baseRequest({
    url: `/system/menu/${id}`,
    method: 'delete'
  });
} 